package com.bawei.module_mine.ui

import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.bawei.lib_mvi.Router
import com.bawei.lib_mvi.base.BaseActivity
import com.bawei.module_mine.adapter.HelpAdapter
import com.bawei.module_mine.databinding.ActivityHelpBinding
import com.bawei.module_mine.model.HelpModel

@Route(path = Router.Ui.HELP_ACTIVITY)
class HelpActivity : BaseActivity() {
    private val binding by lazy { ActivityHelpBinding.inflate(layoutInflater) }
    lateinit var helpAdapter : HelpAdapter
    lateinit var helpAdapter1 : HelpAdapter
    var helpItemEntity = listOf<HelpModel>()
    var helpItemEntity1 = listOf<HelpModel>()

    override fun initView() {
        super.initView()
        helpItemEntity = listOf(
            HelpModel("找回账号","原登录方式已忘记，或无法使用时，点此找回账号"),
            HelpModel("锁定保护","手机丢失或怀疑账号被盗，及时锁定账号"),
            HelpModel("解除锁定","确保账号安全后，解除锁定可以恢复账号正常使用")
        )
        helpItemEntity1 = listOf(
            HelpModel("使用手机号登录遇到问题",""),
            HelpModel("使用头条/微博登录遇到问题",""),
            HelpModel("账号被封禁","")
        )
        helpAdapter = HelpAdapter(helpItemEntity)
        helpAdapter1 = HelpAdapter(helpItemEntity1)
        binding.rvHelp.adapter = helpAdapter
        binding.rvWen.adapter = helpAdapter1
        binding.rvHelp.layoutManager = LinearLayoutManager(this)
        binding.rvWen.layoutManager = LinearLayoutManager(this)
        binding.llAllWen.setOnClickListener {
            ARouter.getInstance().build(Router.Ui.ALL_HELP_ACTIVITY).navigation()
        }
        binding.ivBack.setOnClickListener{
            finish()
        }
    }


    override fun getLayoutRootView(): View {
        return binding.root
    }

}